/**
 * Created by c on 2017-11-29.
 */
//加载操作信息
function caozuo(e,value,row){
    var $str ;
    $str = '<button type="button" class="layui-btn layui-btn-mini showDetail" >查看</button>';
    return $str;
}

//模糊查询
function search(){
    var param={};
    param.dsNum=$("input[name='dsNum']").val();
    param.woName=$("input[name='woName']").val();
    param.ruStartDate=$("input[name='ruStartDate']").val();
    param.ruEndDate=$("input[name='ruEndDate']").val();
    $("#ruTable").bootstrapTable("refresh",{query:param});
}

//搜索日期插件
$(function () {
    laydate.render({
        elem:'[name=ruStartDate]'
    })
    laydate.render({
        elem:'[name=ruEndDate]'
    })
});

window.optEvents= {
    "click .showDetail": function (e,value,row) {
        location.href = ctx+"/drug/searchOneRu?dsNum="+row.dsNum;
    },
    "click .plannum": function (e,value,row) {
        swal({
         title:"提示",
         text:"要转入查看采购信息吗?",
         type:"warning",
         showCancelButton:true,
         closeOnConfirm:false,
         confirmButtonText:"查看",
         confirmButtonColor:"#19A094",
         cancelButtonText: "取消"
         }).then(function(){
            location.href = ctx+"/pur/purview/index?planNum="+row.planNum;
        });
    }
}

function initplanNum(value){
    return '<a href="javaScript:void(0);" class="plannum">'+value+'</a>';
}